package lab02.test13;

public class Gymnastics extends ComputerAverage {
    double score1;
    double score2;
    double score3;
    double score4;
    double score5;
    @Override
    double getaverage() {
        double tem = 0;
        double sum=0.0;
     double[] score6={score1,score2,score3,score4,score5};
     for(int i=0;i<score6.length;i++){
         for(int j=0;j<score6.length-1-i;j++){
             if(score6[j]<score6[j+1]){
                 tem=score6[j];
                 score6[j]=score6[j+1];
                 score6[j+1]=tem;
             }
         }
     }
     for (int i=1;i<score6.length-1;i++){
         sum=sum+score6[i];
     }
        return sum/5;
    }
}
